<?php
 /*
 * 1626cms 簡歷聯系方式
 * ============================================================================
 * 版權所有: 1626網絡，并保留所有權利。
 * 網站地址: http://www.1626.com；
 * ----------------------------------------------------------------------------
 * 這不是一個自由軟件！您只能在不用于商業目的的前提下對程序代碼進行修改和
 * 使用；不允許對程序代碼以任何形式任何目的的再發布。
 * ============================================================================
*/
define('IN_QISHI', true);
require_once('../include/common.inc.php');
header("Content-Type: application/x-javascript;charset=utf8");
$resume_id=intval($_GET['resume_id']);
if (intval($resume_id)!=$resume_id || $resume_id=='') die('參數錯誤');
require_once(QISHI_ROOT_PATH.'include/mysql.class.php');
$db = new mysql($dbhost,$dbuser,$dbpass,$dbname);
unset($dbhost,$dbuser,$dbpass,$dbname);
if($_CFG['visitor_resume']=="1")//假如允許如何用戶查看聯系方式
{
$sql = "select * from ".table('resume')." WHERE  id=".intval($resume_id);
$val=$db->getone($sql);
echo "var text=\"\";\r\n";
echo "text+=\"<div class='resume_show_contact_in'>聯系電話：".$val['telephone']."</div>\";\r\n";
echo "text+=\"<div class='resume_show_contact_in'>聯系郵箱：".$val['email']."</div>\";\r\n";
echo "text+=\"<div class='resume_show_contact_in'>聯系 Q Q：".$val['qq']."</div>\";\r\n";
echo "text+=\"<div class='resume_show_contact_in'>聯系地址：".$val['address']."</div>\";\r\n";
echo "text+=\"<div class='resume_show_contact_in'>個人主頁/博客：".$val['website']."</div>\";\r\n";
echo "text+=\"<div class='clear'></div>\";\r\n";
echo "document.getElementById('resumecontact').innerHTML=text;";
exit;
}
if($_SESSION['uid'] && $_SESSION['username'] && $_SESSION['utype']=='1')//假如已經登入
{
$points_rule=get_cache('members_points_rule');
require_once(QISHI_ROOT_PATH.'include/fun_user_company.php');
		if(check_down_resumeid($resume_id,$_SESSION['uid']))//假如已經下載過了
		{
			$sql = "select * from ".table('resume')." WHERE id=".$resume_id;
			$val=$db->getone($sql);
			$points=$val['talent']=="2"?$points_rule['interview_invite_advanced']:$points_rule['interview_invite'];
			echo "var text=\"\";\r\n";
			echo "text+=\"<div class='resume_show_contact_in'>聯系電話：".$val['telephone']."</div>\";\r\n";
			echo "text+=\"<div class='resume_show_contact_in'>聯系郵箱：".$val['email']."</div>\";\r\n";
			echo "text+=\"<div class='resume_show_contact_in'>聯系 Q Q：".$val['qq']."</div>\";\r\n";
			echo "text+=\"<div class='resume_show_contact_in'>聯系地址：".$val['address']."</div>\";\r\n";
			echo "text+=\"<div class='resume_show_contact_in'>個人主頁/博客：".$val['website']."</div>\";\r\n";
			echo "text+=\"<div class='clear'></div>\";\r\n";
			echo "text+='<div align=\'center\'><br/><a href=\'".$_CFG['site_dir']."member_company.php?act=invitation_interview&resume_id=".$resume_id."&resume_uid=".$val['uid']."&resume_name=".$val['fullname']."\' ><img src=\'".$_CFG['site_template']."images/invite.gif\'  border=\'0\'/></a></div>';\r\n";
			echo "text+='<div align=\'center\' class=\'link_lan\'><br/><a href=\'".$_CFG['site_dir']."member_company.php?act=down_resume_perform&shift=addt&y_id=".$resume_id."\' >[添加到人才庫]</a></div>';\r\n";
			echo "document.getElementById('resumecontact').innerHTML=text;";
		}
		else//否則顯示下載按鈕
		{
			$resumeusql = "select * from ".table('resume')."  WHERE  id =".$resume_id;
			$resume=$db->getone($resumeusql);
			$resume_uid=$resume['uid'];
			$points=$resume['talent']=='2'?$points_rule['resume_download_advanced']:$points_rule['resume_download'];
			echo "var text=\"\";\r\n";
			echo "text='<div align=\'center\'><a href=\'".$_CFG['site_dir']."member_company.php?act=down_resume&resume_id=".$resume_id."&resume_uid=".$resume_uid."\' ><img src=\'".$_CFG['site_template']."images/btn_down.gif\'  border=\'0\' onClick=\"return confirm(\'下載此簡歷將扣除您  ".$points." ".$_CFG['points_quantifier'].$_CFG['points_byname']."，您確定下載嗎?\')\"/></a></div>';\r\n";
			echo "document.getElementById('resumecontact').innerHTML=text;";
			exit;
		}
}
else
{
	echo "document.write('企業用戶 <a href=\"".url_rewrite('user')."\">登入</a> 會員中心后查看聯系方式，如果您不是企業會員，請先 <a href=\"".url_rewrite('user')."?act=reg1\">免費注冊</a> 企業會員');\r\n";
}
?>
